using System;
using Rhino.Etl.Core;
using Rhino.Etl.Core.Operations;

namespace Sqloogle.Operations
{
    public class CachedObjectStatsJoin : JoinOperation {

        protected override Row MergeRows(Row leftRow, Row rightRow) {
            var row = leftRow.Clone();
            row["use"] = rightRow["use"];
            row["lastused"] = DateTime.Now;
            return row;
        }

        protected override void SetupJoinConditions() {
            LeftJoin.Left("database", "objectid").Right("database", "objectid");
        }
    }
}